<template lang="html">
  <div class="container-box">
    <div class="details-pic-box">
      <div class="details-pic1">
        <TopBack  />
        <img src="../../assets/img/workshop/sl3.gif" alt="">
      </div>
    </div>
    <div class="price-box">
      <h2>红豆薏仁粉</h2>
      <div class="price-right">
        <span class="span1">￥</span>
        <span class="span2">98</span>
      </div>
    </div>
    <div class="container-title-box">
      <div class="title-box">
        <h3>商品详情</h3>
      </div>
      <div class="title-box">
        <img  :src="item" alt="" v-for="(item,index) in imglist" :key="index"/>
      </div>
   </div>
   <JoinShopping />
   <Cartshopping />
  </div>
</template>

<script>

import JoinShopping from "../../components/Worksshop/Joinshopping"
import TopBack from "../../components/TopBack.vue"
import Cartshopping from "../../components/cart/CartIcon"
export default {
  name:"Details",
  data(){
    return{
      imglist:[]
    }
  },
  components:{
    JoinShopping,
    TopBack,
    Cartshopping
  },
  mounted(){
    this.$axios.get(this.HOST + "/api/goodslist?size=5&typeId=1111&offset=0")
    .then(res => {
      this.imglist = res.data[0].goods_detail.goods_images
    })
    .catch(error => {
      console.log(error)
    })
  }
}
</script>

<style lang="less" scoped>
.container-box{
  width: 100%;
  top: 0;
  background-color: #f1f1f1;
  .details-pic-box{
    width: 100%;
    height: 4rem;
    background: red;
    position: relative;
    .details-pic1{
      img{
        width: 100%;
        height: 4rem;
      }
    }
    .details-pic2{
      position: absolute;
      top: 1rem;
      bottom: 0;
      img{
        width:70%;
        height: 3rem;
        background-size: 2rem;
      }
    }
  }
  .price-box{
    width: 100%;
    height: 1rem;
    margin-top: 0.1rem;
    h2{
      font-weight: normal;
      float: left;
      margin-right: 0.5rem;
    }
    .price-right{
      width: 15%;
      height: 1rem;
      float: right;
      .span1{
        color: #ED2A29;
      }
      .span2{
        color: #ED2A29;
        font-size: 0.5rem;
      }
    }
  }
  .container-title-box{
    width: 100%;
    position: relative;
    .title-box{
      width: 100%;
      h3{
        text-align: center;
      }
      img{
        width: 100%;
        margin-top:0.1rem;
      }
    }
  }
}
</style>
